<?php 
session_start();
require_once("include/authen.php");
require_once("include/ui.php");

if ($_SESSION["permission"][$customerScreen]["View"]=="0"){
	echo "<script>alert('".$no_permit."');</script>";
	echo "<meta http-equiv = refresh ; content = '0 ; url = mainscreen.php'>";
	exit();
}

echo headerPage("Customer Information Report");
?>
<SCRIPT src="js/js_cust_info.js"></SCRIPT> 
<script>
$(function() {
 

	$("#Telephone").keypress(function(e){
		//alert(e);
		if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57)){
			return false;
		}
	});
	 
	$("#BirthDay").datepicker({ dateFormat: 'dd/mm/yy',
				showOn: "button",
				changeMonth: true,
				changeYear: true,
				yearRange:'c-35:c+1',
				buttonImage: "images/Calendar.png",
				buttonImageOnly: true });
				
	$( "#txtDateFrom" ).datepicker({ dateFormat: 'dd/mm/yy',
		showOn: "button",
		changeMonth: true,
		changeYear: true,
		yearRange:'c-35:c+1',
		buttonImage: "images/Calendar.png",
		buttonImageOnly: true });
				
	$( "#txtDateTo" ).datepicker({ dateFormat: 'dd/mm/yy',
		showOn: "button",
		changeMonth: true,
		changeYear: true,
		yearRange:'c-35:c+1',		
		buttonImage: "images/Calendar.png",
		buttonImageOnly: true });
	$('#txtLastedDateTo').datepicker({ dateFormat: 'dd/mm/yy',
		showOn: "button",
		changeMonth: true,
		changeYear: true,
		yearRange:'c-10:c+1',			
		buttonImage: "images/Calendar.png",
		buttonImageOnly: true });
		
	$('#txtLastedDateFrom').datepicker({ dateFormat: 'dd/mm/yy',
		showOn: "button",
		changeMonth: true,
		changeYear: true,
		yearRange:'c-10:c+1',			
		buttonImage: "images/Calendar.png",
		buttonImageOnly: true });
	$("#Amount").keypress(function(e){
		
		if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57)){
			return false;
		}
	});	
	
	$( "#txtDateTo" ).datepicker({ dateFormat: 'dd/mm/yy',
		showOn: "button",
		buttonImage: "images/Calendar.png",
		buttonImageOnly: true });
		$("#btnPrint").live('click',function(){
		$("#normal-screen").hide();
		$("#page-header").hide();
		$("#searchdata").hide();
		$(".toolbar-box").hide();
		$("#foolter_table").hide();
		$("#leftboder").hide();
		$("#rightboder").hide();
		window.print();
		
		$("#normal-screen").show();
		$("#page-header").show();
		$("#searchdata").show();
		$(".toolbar-box").show();
		$("#foolter_table").show();
		$("#leftboder").show();
		$("#rightboder").show();
	});	


			
});
</script>
<FORM id="Act" action="upload/index.php" method="post"> 
<INPUT type=hidden value="add" id="mode" name="mode"> 
<INPUT type=hidden value="" id="custid" name="custid"> 
<INPUT type=hidden value="" id="custname" name="custname"> 
<INPUT type=hidden value="" id="hisFrom" name="hisFrom"> 
 
<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10" id='leftboder' style='border-left:2px solid #facb0c;'>&nbsp;</td>
    <td width="1004" valign="top">
        <div class="content-box">
            <div Class="toolbar-box">   
                <div class="t">
                    <div class="t">
                        <div class="t"></div>
                    </div>
                 </div>
                 <div class="m">
                    <div class="toolbar">
                        <table class="toolbar">
                        <tr>
							   <td>
								<a href="javascript:void('0');" title="Print" id="btnPrint">
								<span class="icon_Print"></span>Print
								</a>
							</td>
                        </tr>
                        </table>
                    </div>
                      <div class="header" style="background-image: url(images/doc.png);">
                        Customer Information Report
                      </div>
                <div class="clr"></div>
                 </div>
                 <div class="b">
                    <div class="b">
                        <div class="b"></div>
                    </div>
                 </div>
            </div>
               <div id="element-box">
                <div class="t">
					<div class="t">
						<div class="t"></div>
					</div>
				</div>
                <div class="m">
                    <table width="100%" border="0">
                        <tr>
                            <td width="15%" class="fontSearch" style="padding-left:20">Code : </td>
							<td width="90%" align=left colspan="3">
								<input id="txtCode_s"  title="Filter by code " type="text" size=40 name="txtCode_s" class="boxItem" />
							</td>
						</tr>
                        <tr>
									<td width="15%" class="fontSearch" style="padding-left:20">First Name : </td>
									<td width="20%" align=left >
										<input id="txtName_s"  title="Filter by first name " type="text" size=40 name="txtName_s" class="boxItem" />
									</td>
									<td width="10%" class="fontSearch"  align="right"  >Last Name : </td>
									<td width="55%" align=left >
										<input id="txtLastName_s"  title="Filter by last name " type="text" size=40 name="txtLastName_s" class="boxItem" />
									</td>
						</tr>						
					    <tr>
							<td class="fontSearch" style="padding-left:20">BrithDay : </td>
							<td  align=left colspan="3" >
								<input id="txtDateFrom"  title="Filter by BirthDay " type="text" size=10 name="txtDateFrom" class="boxItem" />
								&nbsp;- <input id="txtDateTo"  title="Filter by BirthDay " type="text" size=10 name="txtDateTo" class="boxItem" />
							</td>
						</tr>
					    <tr>
							<td class="fontSearch" style="padding-left:20">Lasted Access : </td>
							<td  align=left colspan="3" >
								<input id="txtLastedDateFrom"  title="Filter by Lasted Access " type="text" size=10 name="txtLastedDateFrom" class="boxItem" />
								&nbsp;- <input id="txtLastedDateTo"  title="Filter by Lasted Access " type="text" size=10 name="txtLastedDateTo" class="boxItem" />
							</td>
						</tr>			
                        <tr>
                            <td class="fontSearch" style="padding-left:20">Card No. : </td>
							<td  align=left colspan="3">
								<input id="txtCardNo_s"  title="Filter by Card No. " type="text" size=40 name="txtCardNo_s" class="boxItem" />
							</td>
						</tr>							
						 <tr>
							<td/>
							<td colspan="3">
								<a href="javascript:void('0');" id="btnSearch"><img  src="./images/btn-search.gif" border=0/></a> </td>
							</tr>
						 <tr><td colspan="4"></tr>
                    </table>
                    <table cellspacing="1" id="resultData" class=list>
                    <thead>
                       <tr>
								<th width="5%" >No.</th>
								<th width="0" style="display:none;">ID</th>
								<th class="title" width="10%" >Code</th>
								<th  class="title" width="30%"  nowrap="nowrap">Name</th>
								<th  class="title" width="10%"  nowrap="nowrap">Age</th>
								<th  class="title" width="10%"  nowrap="nowrap">Card No.</th>
								<th  class="title" width="10%"  nowrap="nowrap">Telephone</th>
								<th  class="title" width="10%"  nowrap="nowrap">Lasted Access</th>
								<th  class="title" width="10%"  nowrap="nowrap">Updated Date</th>
								<th  class="title" width="5%"  nowrap="nowrap">View</th>
                      </tr>
                    </thead>
                   <tbody>
                     </tbody>
                     <tfoot>
                         <tr>
							<td colspan="9" >
								<div class="boxfooter">
									<div id="paging_btn"></div> 
									<div class="totalpage">Total : <span id="rowCount"></span>&nbsp;&nbsp;rows</div>
								</div>
							</td>
                         </tr>
                     </tfoot>
                    </table>
                  <div class="clr"></div>
                </div>
                 <div class="b"><div class="b"><div class="b"></div></div></div>
                 <div class="clr"></div>
                </div> <!-- elementbox-->
        </div>
    </td>
    <td width="10" id='rightboder' style="border-right:2px solid #facb0c;">&nbsp;</td>
  </tr>
</table>
 </FORM>
 
  <div id="dialog-smartpurse" style="height:500px" >
	<p class="validateTips">* fields are required.</p>
	<form>
	<table cellpadding="0" cellspacing="0" border="0" width="100%" class="fieldset">
		<tr>
			<td width="35%"><label for="name" >Customer Name :</label></td>
			<td width="65%"><label for="custname" id="custname" style="font-weight:normal;"></label></td>
		</tr>
		<tr >
			<td><label for="name" >Card No :</label></td>
			<td><input type="text" name="CardNo"  id="CardNo" class="text ui-widget-content ui-corner-all" /></td>
		</tr>
		<tr >
			<td><label for="name" >Amount :</label></td>
			<td>
				<input type="text" name="Amount"  id="Amount" size="20" class="text ui-widget-content ui-corner-all" />
			</td>
		</tr>	
		<tr>
			<td></td>
			<td><button id="btnSmart" style="font-size:12px">Add</button></td>
		<tr/>
		<tr>
			<td colspan="2" style="padding-top:2px;">
				<fieldset  class="ui-widget ui-widget-content">
				<legend><label id="lblGroup">History</label></legend>		
				<div class="ui-widget" style="font-size:12px;margin-top:-20px;">
				<table id="tbNewSmart" cellspacing="1" width="100%"  cellpadding="3" border="0" style="background-color:#f9f9f9;font-size:12px;border:1px solid #EAEAEA;line-height:20px;">
					<thead>
						<tr style="background-color:#CCC;font-weight:bold;">
							<th width="10%">#</th>
							<th style="display:none">ID</th>
							<th width="25%">Date</th>
							<th width="35%">Card No.</th>
							<th width="20%">Amount</th>
							<th width="10%">Del</th>
						</tr>
					</thead>
					<tbody style="font-weight:normal;background-color:#fff">
					</tbody>
				</table>
				</div>
				</fieldset>
			</td>
		</tr>
	</table>
</form>
</div>
<div id="dialog-confirm" title="Confirm delete?">
	<p><span class="ui-icon ui-icon-alert" 
		style="float:left; margin:0 7px 20px 0;">
		</span>Are you sure this customer?</p>
</div>

<div id="dialog-form" >
	<p class="validateTips">* fields are required.</p>
	<form>
	<table cellpadding="0" cellspacing="2" border="0" width="100%" class="fieldset">
		<tr>
			<td width="35%"><label for="name" >Code *</label></td>
			<td width="65%"><input type="text" name="Code"  id="Code" class="text ui-widget-content ui-corner-all" />
			</td>
		</tr>
		<tr >
			<td><label for="name" >Sex * </label></td>
			<td>
				<input type="radio" name="Sex" id="Sex_1" value="0" checked />Female
				<input type="radio" name="Sex" id="Sex_2" value="1"   />Male
			</td>
		</tr>
		<tr >
			<td><label for="name" >First Name * </label></td>
			<td><input type="text" name="FirstName"  id="FirstName" class="text ui-widget-content ui-corner-all" /></td>
		</tr>
		<tr >
			<td><label for="name" >Last Name * </label></td>
			<td><input type="text" name="LastName"  id="LastName" class="text ui-widget-content ui-corner-all" /></td>
		</tr>		
		<tr >
			<td ><label for="name" >Birth Day</label></td>
			<td ><input type="text" name="BirthDay" size="20"  id="BirthDay" value="" class="text ui-widget-content ui-corner-all" /></td>
		</tr>
		<tr>
			<td><label for="name" >Address *</label></td>
			<td><textarea id="Address" rows="3" cols="35" class="text ui-widget-content ui-corner-all" ></textarea></td>
		</tr>
		<tr>
			<td><label for="name" >Email </label></td>
			<td><input type="text" name="Email" id="Email" value="" class="text ui-widget-content ui-corner-all" /></td>
		</tr>			
		<tr>
			<td><label for="name" >Telephone *</label></td>
			<td><input type="text" name="Telephone" id="Telephone" value="" class="text ui-widget-content ui-corner-all" /></td>
		</tr>	
		<tr>
			<td><label for="name" >Card No</label></td>
			<td><input type="text" name="CardID" id="CardID" value="" maxlength="20" class="text ui-widget-content ui-corner-all" /></td>
		</tr>	
		<tr>
			<td><label for="name" >Create date </label></td>
			<td><input type="text" name="CreatedDate" id="CreatedDate" readonly  disabled value="" class="text ui-widget-content ui-corner-all" /></td>
		</tr>			
	</table>
</form>
</div>
<?php echo footer();?>